﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.BLL;
using KPIS.GERP.GFMS.MODEL;

namespace KPIS.GERP.GFMS.SERVICE
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class FIM_MoneyRequests : System.Web.Services.WebService
    {
        IBLL_FIM_MoneyRequests bll = new B_FIM_MoneyRequests();
        IBLL_CodeGenerate bll2 = new B_CodeGenerate();
        
        [WebMethod]
        public string GenerateNextMoneyRequestBorrowNumber(string strBgmSourceNo)
        {
            return bll2.GetNextCode(TransectionType.FimMoneyRequestBorrowNo, strBgmSourceNo);
        }

        [WebMethod]
        public string GenerateNextMoneyRequestRefNo(string strBgmSourceNo)
        {
            return bll2.GetNextCode(TransectionType.FimMoneyRequestRefNo, strBgmSourceNo);
        }

        [WebMethod]
        public List<M_FIM_MoneyRequests> GetFull(string bgm_source_seq, string bgm_year
            , string work_area_seq, string event_seq, string contact_seq, string emp_seq, bool bReadyToPay)
        {
            return (List<M_FIM_MoneyRequests>)bll.GetFull(bgm_source_seq, bgm_year, work_area_seq
                , event_seq, contact_seq, emp_seq, null, bReadyToPay);
        }

        [WebMethod]
        public List<M_FIM_MoneyRequests> GetList(string bgm_source_seq
            , string bgm_year, string work_area_seq, string event_seq
            , string contact_seq, string emp_seq, string filter)
        {
            return (List<M_FIM_MoneyRequests>)bll.GetList(bgm_source_seq
            , bgm_year, work_area_seq, event_seq
            , contact_seq, emp_seq, filter);
        }

        [WebMethod]
        public M_FIM_MoneyRequests GetNotReturnInfo(string money_req_seq, string return_seq)
        {
            return GetNotReturnInfo(money_req_seq, return_seq);
        }

        [WebMethod]
        public List<M_FIM_MoneyRequests> GetPetitionList(string bgm_source_seq
            , string bgm_year, string work_area_seq, string event_seq
            , string contact_seq, string emp_seq, string filter)
        {
            return (List<M_FIM_MoneyRequests>)bll.GetPetitionList(bgm_source_seq
                , bgm_year, work_area_seq, event_seq
                , contact_seq, emp_seq, filter);
        }

        [WebMethod]
        public List<M_FIM_MoneyRequests> GetNotPetition(string bgm_source_seq
            , string bgm_year, string petition_seq, string bgm_exp_grp_seq)
        {
            return (List<M_FIM_MoneyRequests>)bll.GetNotPetition(bgm_source_seq
                , bgm_year, petition_seq, bgm_exp_grp_seq);
        }

        [WebMethod]
        public List<M_FIM_MoneyRequests> GetNotReturnList(string return_seq
            , string emp_seq, string contact_person_seq)
        {
            return (List<M_FIM_MoneyRequests>)bll.GetNotReturnList(return_seq
                , emp_seq, contact_person_seq);
        }

        [WebMethod]
        public M_FIM_MoneyRequests GetDnDeductInfo(string seq)
        {
            return bll.GetDnDeductInfo(seq);
        }

        [WebMethod]
        public List<M_HRM_PR_PayrollDtls> GetSalaryDeductList(string money_req_seq)
        {
            return (List<M_HRM_PR_PayrollDtls>)bll.GetSalaryDeductList(money_req_seq);
        }

        [WebMethod]
        public M_FIM_MoneyRequests GetMoneyReqDNInfo(string seq)
        {
            return bll.GetMoneyReqDNInfo(seq);
        }

        //[WebMethod]
        //public string SelectRecentInsertedRoleSeq()
        //{
        //    return bll.SelectRecentInsertedRoleSeq();
        //}

        [WebMethod]
        public M_FIM_MoneyRequests GetInfo(string seq)
        {
            return bll.GetInfo(seq);
        }

        [WebMethod]
        public string Insert(M_FIM_MoneyRequests info)
        {
            return bll.Insert(info);
        }

        [WebMethod]
        public void Update(M_FIM_MoneyRequests info)
        {
            bll.Update(info);
        }

        [WebMethod]
        public void UpdateBidder(M_FIM_MoneyRequests info)
        {
            bll.UpdateBidder(info);
        }

        [WebMethod]
        public void UpdateBgmExpGrpSeq(M_FIM_MoneyRequests info)
        {
            bll.UpdateBgmExpGrpSeq(info);
        }

        [WebMethod]
        public void Delete(M_FIM_MoneyRequests info)
        {
            bll.Delete(info);
        }

        [WebMethod]
        public bool ChangeStatus(M_FIM_MoneyRequests info)
        {
            return bll.ChangeStatus(info);
        }

        [WebMethod]
        public bool UpdateBorrowAllow(M_FIM_MoneyRequests info)
        {
            return bll.UpdateBorrowAllow(info);
        }

        [WebMethod]
        public void UpdateBorrowReturnDate(int paySeq, DateTime payDate)
        {
            bll.UpdateBorrowReturnDate(paySeq, payDate);
        }

        [WebMethod]
        public bool HaveAmountExist(int money_req_seq)
        {
            return bll.HaveAmountExist(money_req_seq);
        }

        [WebMethod]
        public void UpdateUseAdvance(string money_req_seq, string use_advance, string remarks, string updated_by)
        {
            bll.UpdateUseAdvance(money_req_seq, use_advance, remarks, updated_by);
        }

        [WebMethod]
        public DataTable Report_Contract(string seq)
        {
            return bll.Report_Contract(seq);
        }

        [WebMethod]
        public DataTable Report_ContractSub(string seq)
        {
            return bll.Report_ContractSub(seq);
        }

        [WebMethod]
        public string GetNextRefNo(string bgm_year, string bgm_source_seq)
        {
            return bll.GetNextRefNo(bgm_year, bgm_source_seq);
        }

        [WebMethod]
        public string GetNextBorrowNo(string bgm_year, string bgm_source_seq, string use_advance)
        {
            return bll.GetNextBorrowNo(bgm_year, bgm_source_seq, use_advance);
        }

        private void InitializeComponent()
        {

        }
    }
}
